<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>哈哈马帐号登录</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="_token" content="{{ csrf_token() }}"/>

    <link id="callCss" rel="stylesheet" href="/adminHTML/web/themes/bootshop/bootstrap.min.css" media="screen"/>
    <link href="/adminHTML/web/themes/css/base.css" rel="stylesheet" media="screen"/>
<!-- Bootstrap style responsive -->	
	<link href="/adminHTML/web/themes/css/bootstrap-responsive.min.css" rel="stylesheet"/>
	<link href="/adminHTML/web/themes/css/font-awesome.css" rel="stylesheet" type="text/css">
<!-- Google-code-prettify -->	
	<link href="/adminHTML/web/themes/js/google-code-prettify/prettify.css" rel="stylesheet"/>
<!-- fav and touch icons -->
    <link rel="shortcut icon" href="/adminHTML/web/themes/images/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/adminHTML/web/themes/images/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/adminHTML/web/themes/images/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/adminHTML/web/themes/images/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="/adminHTML/web/themes/images/ico/apple-touch-icon-57-precomposed.png">
	<style type="text/css" id="enject">
	 .error{
	display:none;
}</style>
  </head>
<body style='background: #f5f5f5;color: #757575; height:100%'>
	<script src="/adminHTML/web/themes/js/jquery.js" type="text/javascript"></script>
	<script src="/adminHTML/web/themes/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="/adminHTML/web/themes/js/google-code-prettify/prettify.js"></script>
	
	<script src="/adminHTML/web/themes/js/bootshop.js"></script>
    <script src="/adminHTML/web/themes/js/jquery.lightbox-0.5.js"></script>

<!-- Header End====================================================================== -->
<div id="mainBody">
	<div class="container" style="height:550px;margin-top:150px">
	<div class="row" >
</div>
	<div class="span9">
	<div class="row">
		<div class="span4">
		</div>
		<div class="span4">
			<div class="well">
			<h3 style='text-align: center'>哈哈马密码重置</h3>
			<form action="/home/mima" method="post">
			 	@if (session('error'))
				<div class="alert alert-danger" role="alert">
						{{ session('error') }}
				</div>
				@endif
				@if (session('success'))
				<div class="alert alert-success" role="alert">
						{{ session('success') }}
				</div>
				@endif
			  <div class="control-group">
				<label class="control-label" for="inputPassword1">邮箱</label>
				<div class="controls">
				  <input type="text" class="span3" name="email" id="email" placeholder="email">
				  <span class="alert alert-danger error" id="span1" role="alert">邮箱出问题了</span>
				</div>
			  </div>
			<div class="btn btn-default" id="emailyzm">获取验证码</div>
			  <div class="control-group">
				<label class="control-label" for="inputPassword1">验证码</label>
				<div class="controls">
				  <input type="text" class="span2" name="code" id="code" placeholder="code">
				  <span class="alert alert-danger error" id="span6" role="alert">验证码出错了</span>
				</div>
			  </div>

			  <div class="control-group">
			  <div class="control-group">
				<div class="controls">

				  <button type="submit" class="btn">提交</button>
				</div>
			  </div>
			  {{csrf_field()}}
			</form>
		</div>
		</div>
	</div>	
</div>
</div></div>
</div>
<!-- script -->
<script type="text/javascript">
	var NAME = false; //定义全局变量
	var YZM = false;
	$('#email').blur(function(){
		var email = $(this).val();
		// alert(email);
		var reg = /^\w+@\w+\.(com|cn|com.cn|net|org)$/;
		if(!reg.test(email)){
			$('#span1').css('display','block');
			NAME = false;
		}else{
			$('#span1').css('display','none');
			NAME = true;
		}
	})
	var NUM = 0;
	//发送验证码
	$('#emailyzm').click(function(){
		var email = $('#email').val();
		$.ajax({
			url:'/home/email',
			data:{email:email},
			type:'get',
			async:false,
			success:function(data){
				NUM = data;
			}
		})
	})

	//验证码
	$('#code').blur(function(){
		if($(this).val() == NUM){
			YZM = true;
		}else{
			$('#span6').css('display','block');
		}
	})

	$('form').submit(function(){
	//触发所有的丧失焦点事件
	if(NAME && YZM){
		return true;
	}
	//阻止默认行为
		return false;
	})


	// $('#email').blur(function(){
	// 	var email = $(this).val();
	// 	$.ajax({
	// 		url:'/home/checkemail',
	// 		data:{email:email},
	// 		type:'get',
	// 		async:false,
	// 		success:function(data){
	// 			if(data == 1){
	// 				NAME = true;
	// 			}else{
	// 				NAME = false;
	// 			}
	// 		}
	// 	})
	// })

</script>
<!-- Footer ================================================================== -->
	<div  id="footerSection">
	<div class="container">
		<div class="row">
			<div class="span2">
				<h5>帮助中心</h5>
				<a href="#">账户管理</a>
				<a href="#">购物指南</a> 
				<a href="#">ADDRESSES</a> 
				<a href="#">订单操作</a>  
				<a href="#">ORDER HISTORY</a>
			 </div>
			<div class="span2">
				<h5>服务与支持</h5>
				<a href="#">售后政策</a>  
				<a href="#">自助服务</a>  
				<a href="#">相关下载</a>  
				
			 </div>
			<div class="span2">
				<h5>下线门店</h5>
				<a href="#">小米之家</a> 
				<a href="#">服务网点</a>  
				<a href="#">零售网点</a>  
				
			 </div>
			 <div class="span2">
				<h5>关注我们</h5>
				<a href="#">新浪微博</a> 
				<a href="#">小米部落</a>  
				<a href="#">官方微信</a>  
				
			 </div>

			<div id="socialMedia" class="span3 pull-right">
				<h5>关于小米</h5>
				<div>
				<a href="#"><img width="60" height="60" src="/qiantai/themes/images/3.jpg" title="facebook" alt="facebook"/></a>
				<a href="#"><img width="60" height="60" src="/qiantai/themes/images/2.jpg" title="twitter" alt="twitter"/></a>
				<a href="#"><img width="60" height="60" src="/qiantai/themes/images/1.jpg" title="youtube" alt="youtube"/></a>
			 </div> 
		 </div>

		<p class="pull-right">&copy;ＨＨＭ</p>
	</div><!-- Container End -->
	</div>




</body>
</html>